import VueRouter from 'vue-router'
//导入tabbar里面对应的路由组件
import home from './components/tabbar/home.vue'
import member from './components/tabbar/member.vue'
import search from './components/tabbar/search.vue'
import shopcar from './components/tabbar/shopcar.vue'
//导入新闻详细页的组件
import newslist from './components/news/newslist.vue'
// 导入详情页对应条数的跳转
import newsinfo from './components/news/newsinfo.vue'
// 导入图片分享列表组件
import photolist from './components/photos/photolist.vue'
//导入图片列表详情页组件
import photoinfo from './components/photos/photoinfo.vue'
// 导入商品列表
import goodslist from './components/goods/goodslist.vue'
// 导入商品详情页
import goodsinfo from './components/goods/goodsinfo.vue'
// 3. 创建路由对象
var router = new VueRouter({
  routes: [
    {
      path: '/', redirect:'/home'
    },
    {
      path: '/home', component: home
    },
    {
      path: '/member', component: member
    },
    {
      path: '/search', component: search
    },
    {
      path: '/shopcar', component: shopcar
    },
    {
      path: '/home/newslist', component: newslist
    },
    {
      path: '/home/newsinfo/:id', component: newsinfo
    },
    {
      path: '/home/photolist', component: photolist
    },
    {
      path: '/home/photoinfo/:id', component: photoinfo
    },
    {
      path: '/home/goodslist', component: goodslist
    },
    {
      path: '/home/goodsinfo/:id', component: goodsinfo, name: 'goodsinfo'
    }
  ],
  linkActiveClass: 'mui-active'
})

// 把路由对象暴露出去
export default router